Skip to content

[BREAKINGCHANGE] Add support for React 19+ - #889

Merged
Gladorme merged 8 commits into
perses:mainfrom
Gladorme:agents/react-compiler-support-18-19
Oct 28, 2026
Merged

Gladorme merged 8 commits into
perses:mainfrom
Gladorme:agents/react-compiler-support-18-19

Conversation

@Gladorme

@Gladorme Gladorme commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Description

Depends on PR: perses/shared#390.
Add support for React 19+, while still keeping React 18 as base.
Related to perses/perses#4578

Done by IA (Opus 5.5)

Breaking change

Plugins will only load on Perses >= 0.56.0.beta.0

Screenshots

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.

Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>

@Nexucis Nexucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Together with perses/shared#390, the use-resize-observer v10 migration and the wider react/react-dom ranges look good.

One thing still prevents plugins from running on a React 19 host. The lockfile still builds plugins with React 18.3.1, and plugins share only react and react-dom, so every bundle includes React 18's react/jsx-runtime. On a React 19 host, that runtime gets the shared React 19 as react and crashes as soon as it loads:

Cannot read properties of undefined (reading 'ReactCurrentOwner')

I reproduced this with React 18.3.1's production runtime against React 19. Until it's fixed, the READMEs' "requires react and react-dom 18 or 19" doesn't hold at runtime. The host-side change is suggested in perses/shared#390.

Comment thread barchart/rsbuild.config.ts Resolved
Gladorme and others added 2 commits October 28, 2026 11:39
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Bump @perses-dev/{client,components,dashboards,explore,plugin-system} to
^0.56.0-beta.0 and apply the breaking changes from perses/shared#390 and
perses/shared#391:

- Share react/jsx-runtime as a singleton in every plugin's Module
  Federation config so plugins use the host's JSX runtime on React 19.
- Upgrade @tanstack/react-table to ^9.2.8 in the table and flamechart
  plugins to match @perses-dev/components, and use concrete row types
  instead of `unknown` for TableColumnConfig.
- Use CellContext<TableFeatures, ...> in the piechart legend test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
@Gladorme
Gladorme marked this pull request as ready for review October 28, 2026 10:50
@Gladorme
Gladorme requested review from a team and andreasgerstmayr as code owners October 28, 2026 10:50
@Gladorme
Gladorme requested review from adrianSepiol and removed request for a team October 28, 2026 10:50

@Nexucis Nexucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Overall it looks good:

  • The Module Federation contract matches the host after perses/shared#390 (react/jsx-runtime and use-resize-observer@10 are both shared by the host).
  • react-compiler-runtime delegates to React 19's built-in __COMPILER_RUNTIME.c, so keeping the compiler target at 18 is fine.
  • There are no leftover React 19 breakers (JSX.Element, defaultProps, react-dom/test-utils, useRef() without an argument).
  • The new react-19 job really runs on React 19 (npm install --no-save updated 48 packages, and type-check and tests pass).
  • The stateful wrappers in the gauge and histogram editor tests make sense for controlled editors.

A few points, with details inline:

  1. Dev mode on a React 19 host: rsbuild dev emits react/jsx-dev-runtime, which isn't shared, so each plugin bundles React 18's dev runtime.
  2. Compatibility with older hosts: this effectively requires Perses >= 0.56. Consider [BREAKINGCHANGE] in the title and holding releases until shared 0.56 is stable rather than beta.
  3. Nits: json/README.md is outdated, and the React 19 CI job could assert the React version it installed.

Comment thread rsbuild.shared.ts Resolved
Comment thread timeseriestable/rsbuild.config.ts Resolved
Comment thread json/package.json Resolved
Comment thread .github/workflows/react.yml Resolved
Gladorme and others added 3 commits October 28, 2026 14:14
- Compile plugin JSX with the production `react/jsx-runtime` even in dev
  mode, so dev builds consume the host's shared JSX runtime instead of
  bundling React 18's `react/jsx-dev-runtime` (broken on a React 19 host).
- Align the json plugin's README and react/react-dom peer range with the
  other plugins (React 18 or 19).
- Assert the React 19 CI job actually installed React 19.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Align the react, react/jsx-runtime and react-dom requiredVersion ranges with the ^18.3.0 || ^19.0.0 peer dependency range.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>

@Nexucis Nexucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the previous comments!

I checked the latest changes locally:

  • Dev mode: a development build of barchart now only imports the shared react/jsx-runtime (no jsxDEV). Fast Refresh still works, because @rsbuild/plugin-react sets refresh independently of development.
  • Version ranges: the Module Federation runtime accepts ^18.3.0 || ^19.0.0 (18.3.x and 19.x pass; 18.2, 17 and 20 don't).
  • Host contract: @perses-dev/plugin-system@0.56.0-beta.0 shares react/jsx-runtime and use-resize-observer v10, which matches the plugins' shared config.
  • Checks: npm run type-check, npm run lint, npm run format:root:check and npm run test pass on React 18, and CI is green, including the React 19 job.

Required: please change the PR title and the merged commit to [BREAKINGCHANGE] Add support for React 19+. These plugins no longer load on a Perses 0.55 host (details inline).

Nit (outside the diff): the snapshot example in the root README.md still shows react/react-dom ^17.0.2 || ^18.0.0 and use-resize-observer ^9.0.0.

Follow-up for perses/perses: the plugin generator templates (internal/cli/cmd/plugin/generate/templates/module/) need the same changes: React range, react/jsx-runtime sharing, swcReactOptions, and use-resize-observer v10. In particular, vitest.config.ts.tmpl aliases use-resize-observer/polyfilled, which no longer exists in v10.

@Gladorme Gladorme changed the title [ENHANCEMENT] Add support for React 19+ [BREAKINGCHANGE] Add support for React 19+ Oct 28, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
@Gladorme
Gladorme added this pull request to the merge queue Oct 28, 2026
Merged via the queue into perses:main with commit d8a20c3 Oct 28, 2026
18 checks passed
@Gladorme
Gladorme deleted the agents/react-compiler-support-18-19 branch October 28, 2026 14:24
DaoDaoNoCode added a commit to DaoDaoNoCode/ai-grid-provider-console that referenced this pull request Oct 28, 2026
perses/shared#390 and perses/plugins#889 merged on 2026-10-28 and ship in
0.56.0-beta.0, so the router setting's exit is React 19 with Perses 0.56 or
later. The notes said the support was still open.

Signed-off-by: Juntao Wang <juntwang@redhat.com>
DaoDaoNoCode added a commit to DaoDaoNoCode/ai-grid-provider-console that referenced this pull request Oct 28, 2026
… support

Perses supports React 19 from 0.56 (perses/shared#390 and
perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each
plugin the console bundles are the first releases with it. They are
pinned exactly: @perses-dev/client, components, dashboards and
plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0,
markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0,
stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0.
They are newer than pnpm's minimum release age, so pnpm-workspace.yaml
excludes them from it until 0.56.0 is released.

The peers only Perses needs move with it: @hookform/resolvers 3.9.1 ->
5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0
(9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now
reports no peer dependency issues. Perses's own zod is now zod 4, the
console's copy.

- The pie chart patch goes: 0.16.0-beta.0 imports `format` from
  'echarts/core' itself (perses/plugins#893). The Dockerfile no longer
  copies the patches folder.
- buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name
  is optional in 0.56: without one, Perses asks for its unsaved-datasource
  proxy (testing a datasource before saving it), which the relay doesn't
  serve, so it throws like a dashboard's own datasource does.
- Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports
  mdi-material-ui/<Icon> without an extension, which Node's ES module
  resolver refuses.
- The dev server aliases those imports to mdi-material-ui/esm/<Icon>.
  The icons are CommonJS files and mdi-material-ui has no "exports" map;
  esbuild's dependency pre-bundling follows Node's rules for an ES module
  importing CommonJS, so the default import is the whole module.exports
  and the Monitoring page fails to render ("Element type is invalid").
  The production build (Rollup) honours __esModule and doesn't need it.

Perses 0.56 still declares Query v4, so the override stays, and so do the
v4 names docs/connect.md lists. The Monitoring chunk grows from about
1,024 kB to 1,178 kB gzipped; a later commit looks into why.

Signed-off-by: Juntao Wang <juntwang@redhat.com>
DaoDaoNoCode added a commit to DaoDaoNoCode/ai-grid-provider-console that referenced this pull request Oct 28, 2026
… support

Perses supports React 19 from 0.56 (perses/shared#390 and
perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each
plugin the console bundles are the first releases with it. They are
pinned exactly: @perses-dev/client, components, dashboards and
plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0,
markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0,
stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0.
They are newer than pnpm's minimum release age, so pnpm-workspace.yaml
excludes them from it until 0.56.0 is released.

The peers only Perses needs move with it: @hookform/resolvers 3.9.1 ->
5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0
(9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now
reports no peer dependency issues. Perses's own zod is now zod 4, the
console's copy.

- The pie chart patch goes: 0.16.0-beta.0 imports `format` from
  'echarts/core' itself (perses/plugins#893). The Dockerfile no longer
  copies the patches folder.
- buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name
  is optional in 0.56: without one, Perses asks for its unsaved-datasource
  proxy (testing a datasource before saving it), which the relay doesn't
  serve, so it throws like a dashboard's own datasource does.
- Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports
  mdi-material-ui/<Icon> without an extension, which Node's ES module
  resolver refuses.
- The dev server aliases those imports to mdi-material-ui/esm/<Icon>.
  The icons are CommonJS files and mdi-material-ui has no "exports" map;
  esbuild's dependency pre-bundling follows Node's rules for an ES module
  importing CommonJS, so the default import is the whole module.exports
  and the Monitoring page fails to render ("Element type is invalid").
  The production build (Rollup) honours __esModule and doesn't need it.

Perses 0.56 still declares Query v4, so the override stays, and so do the
v4 names docs/connect.md lists. The Monitoring chunk grows from about
1,024 kB to 1,178 kB gzipped; a later commit looks into why.

Signed-off-by: Juntao Wang <juntwang@redhat.com>
DaoDaoNoCode added a commit to DaoDaoNoCode/ai-grid-provider-console that referenced this pull request Oct 29, 2026
… support

Perses supports React 19 from 0.56 (perses/shared#390 and
perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each
plugin the console bundles are the first releases with it. They are
pinned exactly: @perses-dev/client, components, dashboards and
plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0,
markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0,
stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0.
They are newer than pnpm's minimum release age, so pnpm-workspace.yaml
excludes them from it until 0.56.0 is released.

The peers only Perses needs move with it: @hookform/resolvers 3.9.1 ->
5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0
(9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now
reports no peer dependency issues. Perses's own zod is now zod 4, the
console's copy.

- The pie chart patch goes: 0.16.0-beta.0 imports `format` from
  'echarts/core' itself (perses/plugins#893). The Dockerfile no longer
  copies the patches folder.
- buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name
  is optional in 0.56: without one, Perses asks for its unsaved-datasource
  proxy (testing a datasource before saving it), which the relay doesn't
  serve, so it throws like a dashboard's own datasource does.
- Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports
  mdi-material-ui/<Icon> without an extension, which Node's ES module
  resolver refuses.
- The dev server aliases those imports to mdi-material-ui/esm/<Icon>.
  The icons are CommonJS files and mdi-material-ui has no "exports" map;
  esbuild's dependency pre-bundling follows Node's rules for an ES module
  importing CommonJS, so the default import is the whole module.exports
  and the Monitoring page fails to render ("Element type is invalid").
  The production build (Rollup) honours __esModule and doesn't need it.

Perses 0.56 still declares Query v4, so the override stays, and so do the
v4 names docs/connect.md lists. The Monitoring chunk grows from about
1,024 kB to 1,178 kB gzipped; a later commit looks into why.

Signed-off-by: Juntao Wang <juntwang@redhat.com>
DaoDaoNoCode added a commit to DaoDaoNoCode/ai-grid-provider-console that referenced this pull request Oct 29, 2026
… support

Perses supports React 19 from 0.56 (perses/shared#390 and
perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each
plugin the console bundles are the first releases with it. They are
pinned exactly: @perses-dev/client, components, dashboards and
plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0,
markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0,
stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0.
They are newer than pnpm's minimum release age, so pnpm-workspace.yaml
excludes them from it until 0.56.0 is released.

The peers only Perses needs move with it: @hookform/resolvers 3.9.1 ->
5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0
(9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now
reports no peer dependency issues. Perses's own zod is now zod 4, the
console's copy.

- The pie chart patch goes: 0.16.0-beta.0 imports `format` from
  'echarts/core' itself (perses/plugins#893). The Dockerfile no longer
  copies the patches folder.
- buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name
  is optional in 0.56: without one, Perses asks for its unsaved-datasource
  proxy (testing a datasource before saving it), which the relay doesn't
  serve, so it throws like a dashboard's own datasource does.
- Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports
  mdi-material-ui/<Icon> without an extension, which Node's ES module
  resolver refuses.
- The dev server aliases those imports to mdi-material-ui/esm/<Icon>.
  The icons are CommonJS files and mdi-material-ui has no "exports" map;
  esbuild's dependency pre-bundling follows Node's rules for an ES module
  importing CommonJS, so the default import is the whole module.exports
  and the Monitoring page fails to render ("Element type is invalid").
  The production build (Rollup) honours __esModule and doesn't need it.

Perses 0.56 still declares Query v4, so the override stays, and so do the
v4 names docs/connect.md lists. The Monitoring chunk grows from about
1,024 kB to 1,178 kB gzipped; a later commit looks into why.

Signed-off-by: Juntao Wang <juntwang@redhat.com>
DaoDaoNoCode added a commit to DaoDaoNoCode/ai-grid-provider-console that referenced this pull request Oct 29, 2026
… support

Perses supports React 19 from 0.56 (perses/shared#390 and
perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each
plugin the console bundles are the first releases with it. They are
pinned exactly: @perses-dev/client, components, dashboards and
plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0,
markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0,
stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0.
They are newer than pnpm's minimum release age, so pnpm-workspace.yaml
excludes them from it until 0.56.0 is released.

The peers only Perses needs move with it: @hookform/resolvers 3.9.1 ->
5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0
(9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now
reports no peer dependency issues. Perses's own zod is now zod 4, the
console's copy.

- The pie chart patch goes: 0.16.0-beta.0 imports `format` from
  'echarts/core' itself (perses/plugins#893). The Dockerfile no longer
  copies the patches folder.
- buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name
  is optional in 0.56: without one, Perses asks for its unsaved-datasource
  proxy (testing a datasource before saving it), which the relay doesn't
  serve, so it throws like a dashboard's own datasource does.
- Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports
  mdi-material-ui/<Icon> without an extension, which Node's ES module
  resolver refuses.
- The dev server aliases those imports to mdi-material-ui/esm/<Icon>.
  The icons are CommonJS files and mdi-material-ui has no "exports" map;
  esbuild's dependency pre-bundling follows Node's rules for an ES module
  importing CommonJS, so the default import is the whole module.exports
  and the Monitoring page fails to render ("Element type is invalid").
  The production build (Rollup) honours __esModule and doesn't need it.

Perses 0.56 still declares Query v4, so the override stays, and so do the
v4 names docs/connect.md lists. The Monitoring chunk grows from about
1,024 kB to 1,178 kB gzipped; a later commit looks into why.

Signed-off-by: Juntao Wang <juntwang@redhat.com>
cfchase pushed a commit to DaoDaoNoCode/ai-grid-provider-console that referenced this pull request Nov 2, 2026
… support

Perses supports React 19 from 0.56 (perses/shared#390 and
perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each
plugin the console bundles are the first releases with it. They are
pinned exactly: @perses-dev/client, components, dashboards and
plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0,
markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0,
stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0.
They are newer than pnpm's minimum release age, so pnpm-workspace.yaml
excludes them from it until 0.56.0 is released.

The peers only Perses needs move with it: @hookform/resolvers 3.9.1 ->
5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0
(9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now
reports no peer dependency issues. Perses's own zod is now zod 4, the
console's copy.

- The pie chart patch goes: 0.16.0-beta.0 imports `format` from
  'echarts/core' itself (perses/plugins#893). The Dockerfile no longer
  copies the patches folder.
- buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name
  is optional in 0.56: without one, Perses asks for its unsaved-datasource
  proxy (testing a datasource before saving it), which the relay doesn't
  serve, so it throws like a dashboard's own datasource does.
- Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports
  mdi-material-ui/<Icon> without an extension, which Node's ES module
  resolver refuses.
- The dev server aliases those imports to mdi-material-ui/esm/<Icon>.
  The icons are CommonJS files and mdi-material-ui has no "exports" map;
  esbuild's dependency pre-bundling follows Node's rules for an ES module
  importing CommonJS, so the default import is the whole module.exports
  and the Monitoring page fails to render ("Element type is invalid").
  The production build (Rollup) honours __esModule and doesn't need it.

Perses 0.56 still declares Query v4, so the override stays, and so do the
v4 names docs/connect.md lists. The Monitoring chunk grows from about
1,024 kB to 1,178 kB gzipped; a later commit looks into why.

Signed-off-by: Juntao Wang <juntwang@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants